\chapter{Getting Started}
\section{Installing}

Once you have the source tree for Vorpal, only an ISO C++ compiler and STL libraries are needed to build and use the language.  Presently gcc is assumed as your compiler.  The build system is Python based, but there is a shell script that can also be used to build the system.  To compile with the Python build system use the following:
\begin{lstlisting}
	$ ./build vorpal
\end{lstlisting}

If Python is not available, then you can build using the shell script.  Unlike the Python build, the shell script always compiles all source files (leading to slower compiles) and can only build the command line Vorpal system:
\begin{lstlisting}
	$ ./simple-build.sh
\end{lstlisting}
If FLTK is installed, then several other projects which embed Vorpal can be built:
\begin{lstlisting}
	$ ./build all
\end{lstlisting}
To confirm that your installation is running correctly, the test system covered in Section \ref{Testing} can be used.  

\section{Running}

The command line Vorpal application is built in the project \verb-bin-  directory.  Running it will show a list of command line options.  The two primary modes of operation are to list a series of source paths to execute or to enter the interactive mode:
\begin{verbatim}
$ bin/vorpal
Vorpal
-----------
usage: vorpal [options] [source_paths]
       --benchmark | -b : report cpu ticks for execution
    --compile-only | -c : do not execute code
     --disassemble | -d : show compilation result in detail
            --help | -h : show this help text
     --interactive | -i : run interactive console
           --quiet | -q : no extra printing
            --test | -t : run internal tests
\end{verbatim}

The interactive mode allows you to execute individual statements.  Because all execution in Vorpal is based on message passing, each line of code typed must be wrapped in a method and executed as message to some object.  The \verb-system- object receives all these messages.  Local variable are unique to each method execution so locals do not persist across different lines of input. See the Programming chapter for more details (Chapter \ref{Programming}).

\begin{verbatim}
$ bin/vorpal -i
Vorpal
-----------
> (1 + 4).print()
5
> a = 2
> a.print()
Line 0:  method ( ) { a 
                      ^ here: unknown identifier
Syntax error on line 1: 5[1] = 'a' on line 1
??
> self.a = 2
> self.a.print()
2
> quit
-----------
$
\end{verbatim}

\noindent In the example above, a local \verb-a- is created but it cannot be printed by the next input because it no longer exists.  Essentially, the following two methods were executed (the \verb-a- of the first is not defined in the second):

\begin{verbatim}
method( ) { a = 2 }
method( ) { a.print() }
\end{verbatim}

\noindent However, a slot in \verb-self- called \verb-a- persists across inputs as can be seen later in the example where \verb-self.a- is used.

